home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Interfaces / AppleScript 1.1 Interfaces / PInterfaces / OSA.p < prev    next >
Encoding:
Text File  |  1994-04-08  |  19.9 KB  |  653 lines  |  [TEXT/MPS ]

  1. {
  2. ////////////////////////////////////////////////////////////////////////////////
  3. // OPEN SCRIPTING ARCHITECTURE: Client Interface
  4. ////////////////////////////////////////////////////////////////////////////////
  5. // Copyright © 1992 Apple Computer, Inc. All rights reserved.
  6. // Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
  7. ////////////////////////////////////////////////////////////////////////////////
  8. // This interface defines what it means to be a "scripting component."
  9. // Scripting components allow "scripts" to be loaded and executed.  This
  10. // interface does not define the way in which a particular scripting
  11. // component's scripts are editing and debugged.
  12. ////////////////////////////////////////////////////////////////////////////////
  13. }
  14.  
  15. {$IFC UNDEFINED UsingIncludes}
  16. {$SETC UsingIncludes := 0}
  17. {$ENDC}
  18.  
  19. {$IFC NOT UsingIncludes}
  20.     UNIT OSA;
  21.     INTERFACE
  22. {$ENDC}
  23.  
  24. {$IFC UNDEFINED UsingOSA}
  25. {$SETC UsingOSA := 1}
  26.  
  27. {$I+}
  28. {$SETC OSAIncludes := UsingIncludes}
  29. {$SETC UsingIncludes := 1}
  30. {$IFC UNDEFINED UsingAppleEvents}
  31. {$I $$Shell(PInterfaces)AppleEvents.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingAEObjects}
  34. {$I $$Shell(PInterfaces)AEObjects.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED UsingComponents}
  37. {$I $$Shell(PInterfaces)Components.p}
  38. {$ENDC}
  39. {$SETC UsingIncludes := OSAIncludes}
  40.  
  41. { Types and Constants }
  42. CONST
  43.     kOSAComponentType                            = 'osa ';
  44.     kOSAGenericScriptingComponentSubtype        = 'scpt';
  45.  
  46.     kOSAFileType                                = 'osas';
  47.     { Type of script document files. }
  48.  
  49. TYPE
  50.     OSAID                            = LONGINT;
  51.     OSAError                        = ComponentResult;
  52.  
  53. CONST
  54.     kOSANullScript                    = 0;
  55.     kOSANullMode                    = 0;
  56.     kOSAModeNull                    = 0;
  57.     
  58.     kOSASuite                        = 'ascr';
  59.     kOSARecordedText                = 'recd';
  60.     
  61.     kOSAScriptResourceType            = kOSAGenericScriptingComponentSubtype;
  62.     typeOSAGenericStorage            = kOSAScriptResourceType;
  63.  
  64. { Error Codes }
  65.     
  66.     { API Errors }
  67.     errOSASystemError                = -1750;
  68.     errOSAInvalidID                    = -1751;
  69.     errOSABadStorageType            = -1752;
  70.     errOSAScriptError                = -1753;
  71.     errOSABadSelector                = -1754;
  72.     errOSASourceNotAvailable        = -1756;
  73.     errOSANoSuchDialect                = -1757;
  74.     errOSADataFormatObsolete        = -1758;
  75.     errOSADataFormatTooNew            = -1759;
  76.     errOSACorruptData                = errAECorruptData;
  77.     errOSARecordingIsAlreadyOn        = errAERecordingIsAlreadyOn;
  78.  
  79.     { Dynamic errors }
  80.     errOSACantCoerce                = errAECoercionFail;
  81.     errOSACantAccess                = errAENoSuchObject;
  82.     errOSACantAssign                = -10006;
  83.     errOSAGeneralError                = -2700;
  84.     errOSADivideByZero                = -2701;
  85.     errOSANumericOverflow            = -2702;
  86.     errOSACantLaunch                = -2703;
  87.     errOSAAppNotHighLevelEventAware    = -2704;
  88.     errOSACorruptTerminology        = -2705;
  89.     errOSAStackOverflow                = -2706;
  90.     errOSAInternalTableOverflow        = -2707;
  91.     errOSADataBlockTooLarge            = -2708;
  92.     errOSACantGetTerminology        = -2709;
  93.     errOSACantCreate                = -2710;
  94.     
  95.     { Component-specific dynamic script errors: -2720 thru -2739 } 
  96.  
  97.     { Static errors }
  98.     errOSATypeError                    = errAEWrongDataType;
  99.     errOSAMessageNotUnderstood        = errAEEventNotHandled;
  100.     errOSAUndefinedHandler            = errAEHandlerNotFound;
  101.     errOSAIllegalAccess                = errAEAccessorNotFound;
  102.     errOSAIllegalIndex                = errAEIllegalIndex;
  103.     errOSAIllegalRange                = errAEImpossibleRange;
  104.     errOSAIllegalAssign                = -10003;
  105.     errOSASyntaxError                = -2740;
  106.     errOSASyntaxTypeError            = -2741;
  107.     errOSATokenTooLong                = -2742;
  108.     errOSAMissingParameter            = errAEDescNotFound;
  109.     errOSAParameterMismatch            = errAEWrongNumberArgs;
  110.     errOSADuplicateParameter        = -2750;
  111.     errOSADuplicateProperty            = -2751;
  112.     errOSADuplicateHandler            = -2752;
  113.     errOSAUndefinedVariable            = -2753;
  114.     errOSAInconsistentDeclarations    = -2754;
  115.     errOSAControlFlowError            = -2755;
  116.  
  117.     { Component-specific static script errors: -2760 thru -2779 }
  118.  
  119.     { Dialect-specific script errors: -2780 thru -2799 }
  120.  
  121. {
  122. ////////////////////////////////////////////////////////////////////////////////
  123. // OSA Interface Descriptions
  124. ////////////////////////////////////////////////////////////////////////////////
  125. // The OSA Interface is broken down into a required interface, and several
  126. // optional interfaces to support additional functionality.  A given scripting
  127. // component may choose to support only some of the optional interfaces in
  128. // addition to the basic interface.  The OSA Component Flags may be used to 
  129. // query the Component Manager to find a scripting component with a particular
  130. // capability, or determine if a particular scripting component supports a 
  131. // particular capability.
  132. ////////////////////////////////////////////////////////////////////////////////
  133. }
  134.     
  135.     { OSA Component Flags }
  136.     kOSASupportsCompiling                = $0002;
  137.     kOSASupportsGetSource                = $0004;
  138.     kOSASupportsAECoercion                = $0008;
  139.     kOSASupportsAESending                = $0010;
  140.     kOSASupportsRecording                = $0020;
  141.     kOSASupportsConvenience                = $0040;
  142.     kOSASupportsDialects                = $0080;
  143.     kOSASupportsEventHandling            = $0100;
  144.     
  145.     { Component Selectors }
  146.     { Basic Scripting: }
  147.     kOSASelectLoad                        = $0001;
  148.     kOSASelectStore                        = $0002;
  149.     kOSASelectExecute                    = $0003;
  150.     kOSASelectDisplay                    = $0004;
  151.     kOSASelectScriptError                = $0005;
  152.     kOSASelectDispose                    = $0006;
  153.     kOSASelectSetScriptInfo                = $0007;
  154.     kOSASelectGetScriptInfo                = $0008;
  155.     kOSASelectSetActiveProc                = $0009;
  156.     kOSASelectGetActiveProc                = $000A;
  157.     { Compiling: }
  158.     kOSASelectScriptingComponentName    = $0102;
  159.     kOSASelectCompile                    = $0103;
  160.     kOSASelectCopyID                    = $0104;
  161.     { GetSource: }
  162.     kOSASelectGetSource                    = $0201;
  163.     { AECoercion: }
  164.     kOSASelectCoerceFromDesc            = $0301;
  165.     kOSASelectCoerceToDesc                = $0302;
  166.     { AESending: }
  167.     kOSASelectSetSendProc                = $0401;
  168.     kOSASelectGetSendProc                = $0402;
  169.     kOSASelectSetCreateProc                = $0403;
  170.     kOSASelectGetCreateProc                = $0404;
  171.     kOSASelectSetDefaultTarget            = $0405;
  172.     { Recording: }
  173.     kOSASelectStartRecording            = $0501;
  174.     kOSASelectStopRecording                = $0502;
  175.     { Convenience: }
  176.     kOSASelectLoadExecute                = $0601;
  177.     kOSASelectCompileExecute            = $0602;
  178.     kOSASelectDoScript                    = $0603;
  179.     { Dialects: }
  180.     kOSASelectSetCurrentDialect            = $0701;
  181.     kOSASelectGetCurrentDialect            = $0702;
  182.     kOSASelectAvailableDialects            = $0703;
  183.     kOSASelectGetDialectInfo            = $0704;
  184.     kOSASelectAvailableDialectCodeList    = $0705;
  185.     { Event Handling: }
  186.     kOSASelectSetResumeDispatchProc        = $0801;
  187.     kOSASelectGetResumeDispatchProc        = $0802;
  188.     kOSASelectExecuteEvent                = $0803;
  189.     kOSASelectDoEvent                    = $0804;
  190.     kOSASelectMakeContext                = $0805;
  191.  
  192.     kOSASelectComponentSpecificStart    = $1001;
  193.     { scripting component specific selectors are added beginning with this 
  194.       value }
  195.     
  196.     { Mode Flags }
  197.     kOSAModePreventGetSource            = $00000001;
  198.     kOSAModeNeverInteract                = kAENeverInteract;
  199.     kOSAModeCanInteract                    = kAECanInteract;
  200.     kOSAModeAlwaysInteract                = kAEAlwaysInteract;
  201.     kOSAModeDontReconnect                = kAEDontReconnect;
  202.     kOSAModeCantSwitchLayer                = $00000040;
  203.     kOSAModeDoRecord                    = $00001000;
  204.     kOSAModeCompileIntoContext            = $00000002;
  205.     kOSAModeAugmentContext                = $00000004;
  206.     kOSAModeDisplayForHumans            = $00000008;
  207.     kOSAModeDontStoreParent                = $00010000;
  208.     kOSAModeDispatchToDirectObject        = $00020000;
  209.     kOSAModeDontGetDataForArguments        = $00040000;
  210.     
  211. {
  212. ////////////////////////////////////////////////////////////////////////////////
  213. // OSA Basic Scripting Interface
  214. ////////////////////////////////////////////////////////////////////////////////
  215. // Scripting components must at least support the Basic Scripting interface.
  216. ////////////////////////////////////////////////////////////////////////////////
  217. }
  218.  
  219. { Loading and Storing Scripts }
  220.  
  221. FUNCTION
  222. OSALoad(scriptingComponent        : ComponentInstance;
  223.         scriptData                : AEDesc;
  224.         modeFlags                : LONGINT;
  225.         VAR resultingScriptID    : OSAID)
  226.     : OSAError;
  227.     INLINE $2F3C, $000C, $0001, $7000, $A82A;
  228.  
  229. FUNCTION
  230. OSAStore(scriptingComponent            : ComponentInstance; 
  231.          scriptID                    : OSAID; 
  232.          desiredType                : DescType;
  233.          modeFlags                    : LONGINT;
  234.          VAR resultingScriptData    : AEDesc)
  235.     : OSAError;
  236.     INLINE $2F3C, $0010, $0002, $7000, $A82A;
  237.  
  238. { Executing Scripts }
  239.  
  240. FUNCTION
  241. OSAExecute(scriptingComponent            : ComponentInstance;
  242.            compiledScriptID                : OSAID;
  243.            contextID                    : OSAID;
  244.            modeFlags                    : LONGINT;
  245.            VAR resultingScriptValueID    : OSAID)
  246.     : OSAError;
  247.     INLINE $2F3C, $0010, $0003, $7000, $A82A;
  248.  
  249. { Displaying Results }
  250.  
  251. FUNCTION
  252. OSADisplay(scriptingComponent        : ComponentInstance;
  253.            scriptValueID            : OSAID;
  254.            desiredType                : DescType;
  255.            modeFlags                : LONGINT;
  256.            VAR resultingText        : AEDesc)
  257.     : OSAError;
  258.     INLINE $2F3C, $0010, $0004, $7000, $A82A;
  259.  
  260. { Getting Error Information }
  261.  
  262. FUNCTION
  263. OSAScriptError(scriptingComponent                : ComponentInstance;
  264.                selector                            : OSType;
  265.                desiredType                        : DescType;
  266.                VAR resultingErrorDescription    : AEDesc)
  267.     : OSAError;
  268.     INLINE $2F3C, $000C, $0005, $7000, $A82A;
  269.  
  270. CONST    { OSAScriptError selectors: }
  271.     kOSAErrorNumber                = keyErrorNumber;
  272.     kOSAErrorMessage            = keyErrorString;
  273.     kOSAErrorBriefMessage        = 'errb';
  274.     kOSAErrorApp                = 'erap';
  275.     kOSAErrorPartialResult        = 'ptlr';
  276.     kOSAErrorOffendingObject    = 'erob';
  277.     kOSAErrorExpectedType        = 'errt';
  278.     kOSAErrorRange                = 'erng';
  279.  
  280.         { text ranges: }
  281.     typeOSAErrorRange            = 'erng';
  282.     keyOSASourceStart            = 'srcs';
  283.     keyOSASourceEnd                = 'srce';
  284.  
  285. { Disposing Script IDs }
  286.  
  287. FUNCTION
  288. OSADispose(scriptingComponent    : ComponentInstance;
  289.            scriptID                : OSAID)
  290.     : OSAError;
  291.     INLINE $2F3C, $0004, $0006, $7000, $A82A;
  292.  
  293. { Getting and Setting Script Information }
  294.  
  295. FUNCTION
  296. OSASetScriptInfo(scriptingComponent    : ComponentInstance;
  297.                  scriptID            : OSAID;
  298.                  selector            : OSType;
  299.                  value                : LONGINT)
  300.     : OSAError;
  301.     INLINE $2F3C, $000C, $0007, $7000, $A82A;
  302.  
  303. FUNCTION
  304. OSAGetScriptInfo(scriptingComponent    : ComponentInstance;
  305.                  scriptID            : OSAID;
  306.                  selector            : OSType;
  307.                  VAR result            : LONGINT)
  308.     : OSAError;
  309.     INLINE $2F3C, $000C, $0008, $7000, $A82A;
  310.  
  311. CONST    { selectors }
  312.     kOSAScriptIsModified            = 'modi';
  313.     kOSAScriptIsTypeCompiledScript    = 'cscr';
  314.     kOSAScriptIsTypeScriptValue        = 'valu';
  315.     kOSAScriptIsTypeScriptContext    = 'cntx';
  316.     kOSAScriptBestType                = 'best';
  317.     kOSACanGetSource                = 'gsrc';
  318.  
  319. { Manipulating the ActiveProc }
  320.  
  321. TYPE
  322.     OSAActiveProcPtr = ProcPtr;
  323.  
  324. FUNCTION
  325. OSASetActiveProc(scriptingComponent    : ComponentInstance;
  326.                  activeProc            : OSAActiveProcPtr;
  327.                  refCon                : LONGINT)
  328.     : OSAError;
  329.     INLINE $2F3C, $0008, $0009, $7000, $A82A;
  330.  
  331. FUNCTION
  332. OSAGetActiveProc(scriptingComponent    : ComponentInstance;
  333.                  VAR activeProc        : OSAActiveProcPtr;
  334.                  VAR refCon            : LONGINT)
  335.     : OSAError;
  336.     INLINE $2F3C, $0008, $000A, $7000, $A82A;
  337.  
  338. {
  339. ////////////////////////////////////////////////////////////////////////////////
  340. // OSA Optional Compiling Interface
  341. ////////////////////////////////////////////////////////////////////////////////
  342. // Scripting components that support the Compiling interface have the 
  343. // kOSASupportsCompiling bit set in it's ComponentDescription.
  344. ////////////////////////////////////////////////////////////////////////////////
  345. }
  346.  
  347. FUNCTION
  348. OSAScriptingComponentName(
  349.             scriptingComponent                    : ComponentInstance;
  350.             VAR resultingScriptingComponentName    : AEDesc)
  351.     : OSAError;
  352.     INLINE $2F3C, $0004, $0102, $7000, $A82A;
  353.  
  354. FUNCTION
  355. OSACompile(scriptingComponent                : ComponentInstance;
  356.            sourceData                        : AEDesc;
  357.            modeFlags                        : LONGINT;
  358.            VAR previousAndResultingScriptID    : OSAID)
  359.     : OSAError;
  360.     INLINE $2F3C, $000C, $0103, $7000, $A82A;
  361.  
  362. FUNCTION
  363. OSACopyID(scriptingComponent    : ComponentInstance;
  364.           fromID                : OSAID;
  365.           VAR toID                : OSAID)
  366.     : OSAError;
  367.     INLINE $2F3C, $0008, $0104, $7000, $A82A;
  368.  
  369. {
  370. ////////////////////////////////////////////////////////////////////////////////
  371. // OSA Optional GetSource Interface
  372. ////////////////////////////////////////////////////////////////////////////////
  373. // Scripting components that support the GetSource interface have the 
  374. // kOSASupportsGetSource bit set in it's ComponentDescription.
  375. ////////////////////////////////////////////////////////////////////////////////
  376. }
  377.  
  378. FUNCTION
  379. OSAGetSource(scriptingComponent            : ComponentInstance;
  380.              scriptID                    : OSAID;
  381.              desiredType                : DescType;
  382.              VAR resultingSourceData    : AEDesc)
  383.     : OSAError;
  384.     INLINE $2F3C, $000C, $0201, $7000, $A82A;
  385.  
  386. {
  387. ////////////////////////////////////////////////////////////////////////////////
  388. // OSA Optional AECoercion Interface
  389. ////////////////////////////////////////////////////////////////////////////////
  390. // Scripting components that support the AECoercion interface have the 
  391. // kOSASupportsGetSource bit set in it's ComponentDescription.
  392. ////////////////////////////////////////////////////////////////////////////////
  393. }
  394.  
  395. FUNCTION
  396. OSACoerceFromDesc(scriptingComponent            : ComponentInstance;
  397.                   scriptData                    : AEDesc;
  398.                   modeFlags                        : LONGINT;
  399.                   VAR resultingScriptID            : OSAID)
  400.     : OSAError;
  401.     INLINE $2F3C, $000C, $0301, $7000, $A82A;
  402.  
  403. FUNCTION
  404. OSACoerceToDesc(scriptingComponent    : ComponentInstance;
  405.                 scriptID            : OSAID;
  406.                 desiredType            : DescType;
  407.                 modeFlags            : LONGINT;
  408.                 VAR result            : AEDesc)
  409.     : OSAError;
  410.     INLINE $2F3C, $0010, $0302, $7000, $A82A;
  411.  
  412. {
  413. ////////////////////////////////////////////////////////////////////////////////
  414. // OSA Optional AESending Interface
  415. ////////////////////////////////////////////////////////////////////////////////
  416. // Scripting components that support the AESending interface have the 
  417. // kOSASupportsAESending bit set in it's ComponentDescription.
  418. ////////////////////////////////////////////////////////////////////////////////
  419. }
  420.  
  421. TYPE 
  422.     AESendProcPtr = ProcPtr;
  423.     AECreateAppleEventProcPtr = ProcPtr;
  424.     
  425. {  The first two proc pointers have the following interfaces
  426.    taken from AppleEvents.p 
  427.    
  428.     FUNCTION MyAECreateProc(theAEEventClass: AEEventClass;
  429.                             theAEEventID: AEEventID;
  430.                             target: AEAddressDesc;
  431.                             returnID: INTEGER;
  432.                             transactionID: LONGINT;
  433.                             VAR result: AppleEvent): OSErr;
  434.     
  435.     FUNCTION MyAESendProc(theAppleEvent: AppleEvent;
  436.                           VAR reply: AppleEvent;
  437.                           sendMode: AESendMode;
  438.                           sendPriority: AESendPriority;
  439.                           timeOutInTicks: LONGINT;
  440.                           idleProc: IdleProcPtr;
  441.                           filterProc: EventFilterProcPtr): OSErr;
  442.  
  443.     FUNCTION MyActiveProc(): OSErr;
  444.  
  445. }
  446.  
  447. FUNCTION
  448. OSASetSendProc(scriptingComponent    : ComponentInstance;
  449.                sendProc                : AESendProcPtr;
  450.                refCon                : LONGINT)
  451.     : OSAError;
  452.     INLINE $2F3C, $0008, $0401, $7000, $A82A;
  453.  
  454. FUNCTION
  455. OSAGetSendProc(scriptingComponent    : ComponentInstance;
  456.                VAR sendProc            : AESendProcPtr;
  457.                VAR refCon            : LONGINT)
  458.     : OSAError;
  459.     INLINE $2F3C, $0008, $0402, $7000, $A82A;
  460.  
  461. FUNCTION
  462. OSASetCreateProc(scriptingComponent    : ComponentInstance;
  463.                  createProc            : AECreateAppleEventProcPtr;
  464.                  refCon                : LONGINT)
  465.     : OSAError;
  466.     INLINE $2F3C, $0008, $0403, $7000, $A82A;
  467.  
  468. FUNCTION
  469. OSAGetCreateProc(scriptingComponent    : ComponentInstance;
  470.                  VAR createProc        : AECreateAppleEventProcPtr;
  471.                  VAR refCon            : LONGINT)
  472.     : OSAError;
  473.     INLINE $2F3C, $0008, $0404, $7000, $A82A;
  474.  
  475. FUNCTION
  476. OSASetDefaultTarget(scriptingComponent    : ComponentInstance;
  477.                      target                : AEAddressDesc)
  478.     : OSAError;
  479.     INLINE $2F3C, $0004, $0405, $7000, $A82A;
  480.  
  481. {
  482. ////////////////////////////////////////////////////////////////////////////////
  483. // OSA Optional Recording Interface
  484. ////////////////////////////////////////////////////////////////////////////////
  485. // Scripting components that support the Recording interface have the 
  486. // kOSASupportsRecording bit set in it's ComponentDescription.
  487. ////////////////////////////////////////////////////////////////////////////////
  488. }
  489.  
  490. FUNCTION
  491. OSAStartRecording(scriptingComponent            : ComponentInstance;
  492.                   VAR compiledScriptToModifyID    : OSAID)
  493.     : OSAError;
  494.     INLINE $2F3C, $0004, $0501, $7000, $A82A;
  495.  
  496. FUNCTION
  497. OSAStopRecording(scriptingComponent        : ComponentInstance;
  498.                  compiledScriptID        : OSAID)
  499.     : OSAError;
  500.     INLINE $2F3C, $0004, $0502, $7000, $A82A;
  501.  
  502. {
  503. ////////////////////////////////////////////////////////////////////////////////
  504. // OSA Optional Convenience Interface
  505. ////////////////////////////////////////////////////////////////////////////////
  506. // Scripting components that support the Convenience interface have the 
  507. // kOSASupportsConvenience bit set in it's ComponentDescription.
  508. ////////////////////////////////////////////////////////////////////////////////
  509. }
  510.  
  511. FUNCTION 
  512. OSALoadExecute(scriptingComponent            : ComponentInstance;
  513.                scriptData                    : AEDesc;
  514.                contextID                    : OSAID;
  515.                modeFlags                    : LONGINT;
  516.                VAR resultingScriptValueID    : OSAID)
  517.     : OSAError;
  518.     INLINE $2F3C, $0010, $0601, $7000, $A82A;
  519.  
  520. FUNCTION 
  521. OSACompileExecute(scriptingComponent            : ComponentInstance;
  522.                   sourceData                    : AEDesc;
  523.                   contextID                        : OSAID;
  524.                   modeFlags                        : LONGINT;
  525.                   VAR resultingScriptValueID    : OSAID)
  526.     : OSAError;
  527.     INLINE $2F3C, $0010, $0602, $7000, $A82A;
  528.  
  529. FUNCTION 
  530. OSADoScript(scriptingComponent            : ComponentInstance;
  531.             sourceData                    : AEDesc;
  532.             contextID                    : OSAID;
  533.             desiredType                    : DescType;
  534.             modeFlags                    : LONGINT;
  535.             VAR resultingText            : AEDesc)
  536.     : OSAError;
  537.     INLINE $2F3C, $0014, $0603, $7000, $A82A;
  538.  
  539. {
  540. ////////////////////////////////////////////////////////////////////////////////
  541. // OSA Optional Dialects Interface
  542. ////////////////////////////////////////////////////////////////////////////////
  543. // Scripting components that support the Dialects interface have the 
  544. // kOSASupportsDialects bit set in it's ComponentDescription.
  545. ////////////////////////////////////////////////////////////////////////////////
  546. }
  547.  
  548. FUNCTION 
  549. OSASetCurrentDialect(scriptingComponent    : ComponentInstance;
  550.                      dialectCode        : INTEGER)
  551.     : OSAError;
  552.     INLINE $2F3C, $0002, $0701, $7000, $A82A;
  553.  
  554. FUNCTION 
  555. OSAGetCurrentDialect(scriptingComponent            : ComponentInstance;
  556.                      VAR resultingDialectCode    : INTEGER)
  557.     : OSAError;
  558.     INLINE $2F3C, $0004, $0702, $7000, $A82A;
  559.  
  560. FUNCTION 
  561. OSAAvailableDialects(scriptingComponent                : ComponentInstance;
  562.                      VAR resultingDialectInfoList    : AEDesc)
  563.     : OSAError;
  564.     INLINE $2F3C, $0004, $0703, $7000, $A82A;
  565.     { *** This is obsolete. }
  566.     { *** Use OSAAvailableDialectCodeList and OSAGetDialectInfo. }
  567.  
  568. FUNCTION 
  569. OSAGetDialectInfo(scriptingComponent            : ComponentInstance;
  570.                   dialectCode                    : INTEGER;
  571.                   selector                        : OSType;
  572.                   VAR resultingDialectInfo        : AEDesc)
  573.     : OSAError;
  574.     INLINE $2F3C, $000A, $0704, $7000, $A82A;
  575.  
  576. FUNCTION 
  577. OSAAvailableDialectCodeList(scriptingComponent            : ComponentInstance;
  578.                              resultingDialectCodeList    : AEDesc)
  579.     : OSAError;
  580.     INLINE $2F3C, $0004, $0705, $7000, $A82A;
  581.  
  582. CONST
  583.     typeOSADialectInfo                    = 'difo';
  584.     keyOSADialectName                    = 'dnam';
  585.     keyOSADialectCode                    = 'dcod';
  586.     keyOSADialectLangCode                = 'dlcd';
  587.     keyOSADialectScriptCode                = 'dscd';
  588.  
  589. {
  590. ////////////////////////////////////////////////////////////////////////////////
  591. // OSA Optional Event Handling Interface
  592. ////////////////////////////////////////////////////////////////////////////////
  593. // Scripting components that support the Event Handling interface have the 
  594. // kOSASupportsEventHandling bit set in it's ComponentDescription.
  595. ////////////////////////////////////////////////////////////////////////////////
  596. }
  597.  
  598. TYPE
  599.     AEHandlerProcPtr            = EventHandlerProcPtr;
  600.  
  601. FUNCTION
  602. OSASetResumeDispatchProc(scriptingComponent    : ComponentInstance;
  603.                          resumeDispatchProc    : AEHandlerProcPtr;
  604.                          refCon                : LONGINT)
  605.     : OSAError;
  606.     INLINE $2F3C, $0008, $0801, $7000, $A82A;
  607.  
  608. CONST
  609.     { ResumeDispatchProc constants }
  610.     kOSAUseStandardDispatch        = kAEUseStandardDispatch;
  611.     kOSANoDispatch                = kAENoDispatch;
  612.     { OSASetResumeDispatchProc refCon constants }
  613.     kOSADontUsePhac                = $0001;
  614.  
  615. FUNCTION
  616. OSAGetResumeDispatchProc(scriptingComponent        : ComponentInstance;
  617.                          VAR resumeDispatchProc    : AEHandlerProcPtr;
  618.                          VAR refCon                : LONGINT)
  619.     : OSAError;
  620.     INLINE $2F3C, $0008, $0802, $7000, $A82A;
  621.  
  622. FUNCTION
  623. OSAExecuteEvent(scriptingComponent            : ComponentInstance;
  624.                 theAppleEvent                : AppleEvent;
  625.                 contextID                    : OSAID;
  626.                 modeFlags                    : LONGINT;
  627.                 VAR resultingScriptValueID    : OSAID)
  628.     : OSAError;
  629.     INLINE $2F3C, $0010, $0803, $7000, $A82A;
  630.  
  631. FUNCTION
  632. OSADoEvent(scriptingComponent    : ComponentInstance;
  633.            theAppleEvent        : AppleEvent;
  634.            contextID            : OSAID;
  635.            modeFlags            : LONGINT;
  636.            VAR reply            : AppleEvent)
  637.     : OSAError;
  638.     INLINE $2F3C, $0010, $0804, $7000, $A82A;
  639.  
  640. FUNCTION
  641. OSAMakeContext(scriptingComponent        : ComponentInstance;
  642.                contextName                : AEDesc;
  643.                parentContext            : OSAID;
  644.                VAR resultingContextID    : OSAID)
  645.     : OSAError;
  646.     INLINE $2F3C, $000C, $0805, $7000, $A82A;
  647.  
  648. {$ENDC}    { UsingOSA }
  649.  
  650. {$IFC NOT UsingIncludes}
  651.     END.
  652. {$ENDC}
  653.